package com.qiyuexinxi.chat.controller;

import com.qiyuexinxi.chat.common.GenericResponse;
import com.qiyuexinxi.chat.constants.api.DistrictApi;
import com.qiyuexinxi.chat.constants.api.UserApi;
import com.qiyuexinxi.chat.dto.request.GetUserInfoRequest;
import com.qiyuexinxi.chat.dto.request.GetUserListRequest;
import com.qiyuexinxi.chat.service.impl.DistrictServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author yangxingyu
 * @date 2020/3/10
 * @description
 */
@RestController
@Api(description = "城市相关接口")
public class DistrictController {

    @Autowired
    DistrictServiceImpl districtService;

    @GetMapping(value = DistrictApi.GET_DISTRICT_LIST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "获取城市对比信息", notes = "获取城市对比信息")
    public GenericResponse getDistrictList(){
        return new GenericResponse(districtService.getDistrictList());
    }

    @GetMapping(value = DistrictApi.REFRESH_DISTRICT_LIST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "刷新城市对比信息", notes = "刷新城市对比信息")
    public GenericResponse refreshDistrictList(){
        return new GenericResponse(districtService.refreshDistrictList());
    }
    

}
